package com.olympia.myapp.entity;

import android.os.Parcel;
import android.os.Parcelable;

public class Player implements Parcelable {
	public long id = 0;
	public String name = "";
	public String mail = "";
	public String score = "";
	public String retest = "";
	public String level = "";
	public String order = "";
	public String coin = "";

	public Player(long id, String name, String mail, String score,
			String retest, String level, String order, String coin) {
		this.id = id;
		this.name = name;
		this.mail = mail;
		this.score = score;
		this.retest = retest;
		this.level = level;
		this.order = order;
		this.coin = coin;
	}

	// Parcelling part
	public Player(Parcel in) {
		this.id = in.readInt();
		this.name = in.readString();
		this.mail = in.readString();
		this.score = in.readString();
		this.retest = in.readString();
		this.level = in.readString();
		this.order = in.readString();
		this.coin = in.readString();
	}

	public void writeToParcel(Parcel parcel, int flags) {
		parcel.writeLong(id);
		parcel.writeString(name);
		parcel.writeString(mail);
		parcel.writeString(score);
		parcel.writeString(retest);
		parcel.writeString(level);
		parcel.writeString(order);
		parcel.writeString(coin);
	}

	public String toString() {
		return this.name;
	}

	@Override
	public int describeContents() {
		return 0;
	}

	public static final Parcelable.Creator<Player> CREATOR = new Parcelable.Creator<Player>() {

		public Player createFromParcel(Parcel in) {
			return new Player(in);
		}

		public Player[] newArray(int size) {
			return new Player[size];
		}
	};
}
